package org.example.memorystream;

import java.io.ByteArrayInputStream;
import java.io.IOException;

/**
 * 有点鸡肋的 MemoryOutStream
 */
public class MyMemoryOutStream {

    public static void main(String[] args) throws IOException {

        byte[] bytes = "warcraft".getBytes();
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);

        byteArrayInputStream.close();
        int ch;
        while ( (ch = byteArrayInputStream.read()) != -1){
            System.out.println((char) ch);
        }
    }
}
